var _overview = _interopRequireDefault(require("../index/analyze/overview")), _ai = _interopRequireDefault(require("../index/analyze/ai")), _index = _interopRequireDefault(require("../nichedetail/visitor/index"));

function _interopRequireDefault(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}

var TABS_INDEX = {
    ANALYZE: 0,
    AI: 1,
    VISITOR: 2
}, overview = (0, _overview.default)(), ai = (0, _ai.default)(), visitor = (0, _index.default)(), tabs = [ overview, ai, visitor ];

Page({
    data: {
        card: {},
        department: {},
        isMasses: !0
    },
    onLoad: function() {
        this.setData({
            card: this.$take("card.data")
        });
    },
    onPullDownRefresh: function() {
        tabs[this.index].onPullDownRefresh();
    },
    onReachBottom: function() {
        tabs[this.index].onReachBottom();
    },
    index: TABS_INDEX.ANALYZE,
    onNavChange: function(e) {
        var a = e.detail, i = a.index, n = a.reset;
        this.index = i, n && (tabs[i].init(this), tabs[i].loadData && tabs[i].loadData(!0));
    },
    onAnalyzeChange: function(e) {
        var a = e.currentTarget.dataset.index;
        this.index !== a && (this.index = a, overview.chnageAnalyzeIndex(+a));
    },
    onTrendChange: function(e) {
        var a = e.detail.value;
        overview.changeTrendIndex(+a);
    },
    onAiChange: function(e) {
        var a = e.detail.value;
        ai.changeAiIndex(+a);
    }
});